package com.mebs.edi.model.edi.e214;

import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import com.mebs.edi.model.dom.DomChild;
import com.mebs.edi.model.dom.DomEntity;
import com.mebs.edi.model.edi.EdiSt;

/**
 * 
 * ST section of a 214 EDI file 
 * 
 * @author nit
 *
 */
@Entity()
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "edi_214_st")
@PrimaryKeyJoinColumn(name = "Id")
@DomEntity(name = "ST", discriminatorAttribute = "ST01", discriminatorValues = {"214"})
public class Edi214St extends EdiSt {
	
	@Embedded
	@DomChild
	private Edi214B10 b10;
	
	@Embedded
	@DomChild
	private Edi214L11 l11;
	
	@Embedded
	@DomChild(offset = 1)
	private Edi214L11 l11_1;
	
	@Embedded
	@DomChild(offset = 2)
	private Edi214L11 l11_2;
	
	@Embedded
	@DomChild(offset = 3)
	private Edi214L11 l11_3;
	
	@Embedded
	@DomChild(offset = 4)
	private Edi214L11 l11_4;
	
	@Embedded
	@DomChild
	private Edi214Nn nn;
	
	@Embedded
	@DomChild(offset = 1)
	private Edi214Nn nn_1;
	
	@Embedded
	@DomChild
	private Edi214Ng ng;
	
	@Embedded
	@DomChild(offset = 1)
	private Edi214Ng ng_1;
	
	@Embedded
	@DomChild
	private Edi214Lx lx;
	
	@Embedded
	@DomChild
	private Edi214At at;
	
	public Edi214St() {
		super();
	}

	public Edi214B10 getB10() {
		return b10;
	}

	public void setB10(Edi214B10 b10) {
		this.b10 = b10;
	}

	public Edi214L11 getL11() {
		return l11;
	}

	public void setL11(Edi214L11 l11) {
		this.l11 = l11;
	}

	public Edi214L11 getL11_1() {
		return l11_1;
	}

	public void setL11_1(Edi214L11 l11_1) {
		this.l11_1 = l11_1;
	}

	public Edi214L11 getL11_2() {
		return l11_2;
	}

	public void setL11_2(Edi214L11 l11_2) {
		this.l11_2 = l11_2;
	}

	public Edi214L11 getL11_3() {
		return l11_3;
	}

	public void setL11_3(Edi214L11 l11_3) {
		this.l11_3 = l11_3;
	}

	public Edi214L11 getL11_4() {
		return l11_4;
	}

	public void setL11_4(Edi214L11 l11_4) {
		this.l11_4 = l11_4;
	}

	public Edi214Nn getNn() {
		return nn;
	}

	public void setNn(Edi214Nn nn) {
		this.nn = nn;
	}

	public Edi214Nn getNn_1() {
		return nn_1;
	}

	public void setNn_1(Edi214Nn nn_1) {
		this.nn_1 = nn_1;
	}

	public Edi214Ng getNg() {
		return ng;
	}

	public void setNg(Edi214Ng ng) {
		this.ng = ng;
	}

	public Edi214Ng getNg_1() {
		return ng_1;
	}

	public void setNg_1(Edi214Ng ng_1) {
		this.ng_1 = ng_1;
	}

	public Edi214Lx getLx() {
		return lx;
	}

	public void setLx(Edi214Lx lx) {
		this.lx = lx;
	}

	public Edi214At getAt() {
		return at;
	}

	public void setAt(Edi214At at) {
		this.at = at;
	}

	@Override
	public String toString() {
		return "Edi214St [b10=" + b10 + ", l11=" + l11 + ", l11_1=" + l11_1 + ", l11_2=" + l11_2 + ", l11_3="
				+ l11_3 + ", l11_4=" + l11_4 + ", nn=" + nn + ", nn_1=" + nn_1 + ", ng=" + ng + ", ng_1="
				+ ng_1 + ", lx=" + lx + ", at=" + at + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((at == null) ? 0 : at.hashCode());
		result = prime * result + ((b10 == null) ? 0 : b10.hashCode());
		result = prime * result + ((l11 == null) ? 0 : l11.hashCode());
		result = prime * result + ((l11_1 == null) ? 0 : l11_1.hashCode());
		result = prime * result + ((l11_2 == null) ? 0 : l11_2.hashCode());
		result = prime * result + ((l11_3 == null) ? 0 : l11_3.hashCode());
		result = prime * result + ((l11_4 == null) ? 0 : l11_4.hashCode());
		result = prime * result + ((lx == null) ? 0 : lx.hashCode());
		result = prime * result + ((ng == null) ? 0 : ng.hashCode());
		result = prime * result + ((ng_1 == null) ? 0 : ng_1.hashCode());
		result = prime * result + ((nn == null) ? 0 : nn.hashCode());
		result = prime * result + ((nn_1 == null) ? 0 : nn_1.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		Edi214St other = (Edi214St) obj;
		if (at == null) {
			if (other.at != null)
				return false;
		} else if (!at.equals(other.at))
			return false;
		if (b10 == null) {
			if (other.b10 != null)
				return false;
		} else if (!b10.equals(other.b10))
			return false;
		if (l11 == null) {
			if (other.l11 != null)
				return false;
		} else if (!l11.equals(other.l11))
			return false;
		if (l11_1 == null) {
			if (other.l11_1 != null)
				return false;
		} else if (!l11_1.equals(other.l11_1))
			return false;
		if (l11_2 == null) {
			if (other.l11_2 != null)
				return false;
		} else if (!l11_2.equals(other.l11_2))
			return false;
		if (l11_3 == null) {
			if (other.l11_3 != null)
				return false;
		} else if (!l11_3.equals(other.l11_3))
			return false;
		if (l11_4 == null) {
			if (other.l11_4 != null)
				return false;
		} else if (!l11_4.equals(other.l11_4))
			return false;
		if (lx == null) {
			if (other.lx != null)
				return false;
		} else if (!lx.equals(other.lx))
			return false;
		if (ng == null) {
			if (other.ng != null)
				return false;
		} else if (!ng.equals(other.ng))
			return false;
		if (ng_1 == null) {
			if (other.ng_1 != null)
				return false;
		} else if (!ng_1.equals(other.ng_1))
			return false;
		if (nn == null) {
			if (other.nn != null)
				return false;
		} else if (!nn.equals(other.nn))
			return false;
		if (nn_1 == null) {
			if (other.nn_1 != null)
				return false;
		} else if (!nn_1.equals(other.nn_1))
			return false;
		return true;
	}
}
